package ar.com.jendrix.web.util;

import java.util.ArrayList;
import java.util.List;

import javax.faces.model.SelectItem;

import ar.com.jendrix.common.persistence.entity.dto.BaseEntityDTO;
import ar.com.jendrix.common.util.Comparator;
import ar.com.jendrix.login.type.AplicacionType;

public final class SelectItemTypeUtil {

	public static final <DTO extends BaseEntityDTO> List<SelectItem> getSelectItemList(AplicacionType[] typeList) {
		final List<SelectItem> s = new ArrayList<SelectItem>();

		if (!Comparator.isEmpty(typeList)) {
			for (AplicacionType type : typeList) {
				s.add(new SelectItem(type.name(), type.getDescripcion()));
			}
		}
		return s;
	}
}